<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

<h:head></h:head>
<style>
.wdc {
	font-weight: bold;
	font-style: italic;
}

.phc {
	background-color: pink;
	color: red;
	font-weight: bold;
	font-style: italic;
}

.rf-ca-boundary-dates{
	color: gray;
}

.normal-dates{
	background-color: rgb(255, 255, 255);
	color: black;
	font-weight: normal;
}
</style>
<body>
<f:view locale="#{language.locale}">
	<center>
		<h:outputText value="#{leaveRequest.left}" escape="false" />
	</center>
	<h:messages style="color: red" />
	<h:form>
		<h:panelGrid border="1" columns="2">
			<h:outputText value="#{msg['lt']}" />
			<h:selectOneMenu required="true" value="#{leaveRequest.leaveType}">
				<f:selectItem itemValue="" />
				<f:selectItem itemValue="AL" itemLabel="#{msg['AL']}"/>
				<f:selectItem itemValue="SL" itemLabel="#{msg['SL']}"/>
			</h:selectOneMenu>
			<h:outputText value="#{msg['userid']}" />
			<h:outputText value="#{leaveRequest.userID}" />
			<h:outputText value="#{msg['datefrom']}" />
			<rich:calendar popup="true" mode="ajax" showWeeksBar="false"
				dataModel="#{calendarPublicHolidayWeekEnd}" datePattern="yyyy-MM-dd"
				value="#{leaveRequest.dateFrom}" required="true" id="dateFrom">
				<f:ajax event="change" render="days"
					listener="#{leaveRequest.countdays()}" execute="dateFrom dateTo"></f:ajax>
			</rich:calendar>
			<h:outputText value="#{msg['dateto']}" />
			<rich:calendar popup="true" mode="ajax" showWeeksBar="false"
				dataModel="#{calendarPublicHolidayWeekEnd}" datePattern="yyyy-MM-dd"
				value="#{leaveRequest.dateTo}" required="true" id="dateTo">
				<f:ajax event="change" render="days"
					listener="#{leaveRequest.countdays()}" execute="dateFrom dateTo"></f:ajax>
			</rich:calendar>
			<h:outputText value="#{msg['days']}" />
			<h:outputText value="#{leaveRequest.days}" id="days" />
			<h:outputText value="#{msg['reason']}" />
			<h:inputTextarea value="#{leaveRequest.reason}" rows="3"
				style="width: 300px;" />

			<h:commandButton action="#{leaveRequest.req}" value="#{msg['req']}"
				type="submit" />
			<h:commandButton value="#{msg['reset']}" type="reset" />
		</h:panelGrid>
	</h:form>
	<h:outputText value="#{leaveRequest.result}" />
</f:view>
</body>
</html>
